/*****************************************************************************/
/** \file mc_pic.h
**
** 
**
** History:
** 
*****************************************************************************/

#ifndef __MC_PIC_H__
#define __MC_PIC_H__

/*****************************************************************************/
/* Include files */
/*****************************************************************************/

/*****************************************************************************/
/* Global pre-processor symbols/macros ('#define') */
/*****************************************************************************/
#define  s8   signed char
#define  s16  signed short int
#define	 s32  signed int 
#define	 u8   unsigned char 
#define	 u16  unsigned short int 
#define	 u32  unsigned int

/*****************************************************************************/
/* Global type definitions ('typedef') */
/*****************************************************************************/
typedef struct 
{ 	
  s32 Kp;
  s32 Ki;
  s32 Lower_Output;     //Lower Limit for Output limitation
  s32 Upper_Output;     //Lower Limit for Output limitation
  s32 Lower_Integral;   //Lower Limit for Integral term limitation
  s32 Upper_Integral;   //Lower Limit for Integral term limitation
  s32 Integral;
  s32 Out;
  s32 KiSum;
  s32 Error;
} PID_Components;

/*****************************************************************************/
/* Global variable declarations ('extern', definition in C source) */
/*****************************************************************************/
extern PID_Components   PID_ID, PID_IQ, PID_WL, PID_FW, PID_PLL,PID_RL;

/*****************************************************************************/
/* Global function prototypes ('extern', definition in C source) */
/*****************************************************************************/
extern void 			MC_PID_Parameter_Init(void);
extern s32 				PID_CALC(PID_Components *PID_Struct,s32 hReference, s32 hPresentFeedback);
extern s32 				PID_CALC2(PID_Components *PID_Struct,s32 hReference, s32 hPresentFeedback);
extern s32 				PI_Regulator(PID_Components *PID_Struct,s32 hReference, s32 hPresentFeedback);
extern s32 				HL_PI_AntiDump(PID_Components *PID_Struct,s32 hReference, s32 hPresentFeedback);
#endif	/* __MC_PIC_H__ */


